package com.hooper.login.util;

import com.hooper.login.entity.UserDto;

/**
 * @author Tim Hooper
 * @version 1.0
 * @time 2022/12/28/15:03
 */
public class UserHolder {
    private static final ThreadLocal<UserDto> TL = new ThreadLocal<>();

    public static UserDto getUser() {
        return TL.get();
    }

    public static void setUser(UserDto user) {
        TL.set(user);
    }

    public static void remove() {
        TL.remove();
    }

}
